﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Configuration;
using CE.Configuration;
using CE.Database;
using System.Collections;

/// <summary>
/// Summary description for MailCountLog
/// </summary>
/// 

namespace CE.Mail
{
    public class MailCountLog
    {
        //private string _applicationName;
        //public string ApplicationName
        //{
        //    get { return _applicationName; }
        //    set { _applicationName = value; }
        //}

        MyDatabase _db;

        public MailCountLog()
        {
            _db = new MyDatabase("CX_KBDBConnectionString");  
        }

        public void InsertMailCountLog(string applicationName)
        {
            try
            {
                string _spName = "[sproctblGGEmailsLogInsertSingleItem]";
                SortedList _sPara = new SortedList();
                #region Parameter
                string isLive = MyConfigurationManager.GetAppSettingValue("MailCountLive");
                _sPara.Add("@IsLive", isLive);
                _sPara.Add("@ApplicationName", applicationName);
                _sPara.Add("@EmailCount", 1);
                #endregion
                _db.ExecuteSP(_spName, _sPara);
            }
            catch (Exception)
            {
                
            }
            
        }

    }
}
